import 'package:flutter/services.dart';

import 'suota_platform_interface.dart';

/// An implementation of [SuotaPlatform] that uses method channels.
class MethodChannelSuota extends SuotaPlatform {
  /// The method channel used to interact with the native platform.

  final methodChannel = const MethodChannel('suota');

  @override
  Future<String?> getPlatformVersion() async {
    final version =
        await methodChannel.invokeMethod<String>('getPlatformVersion');
    return version;
  }

  //iOS 使用
  @override
  Future<void> disconnect() async {
    await methodChannel.invokeMethod<String>('disconnect');
  }

  @override
  Future<void> startUpdate(String filePath, String name) async {
    // print("startUpdate $filePath");
    await methodChannel.invokeMethod<void>(
        'startUpdate', {"filePath": filePath, "name": name});
  }
}
